import request from '@/utils/request'

/**
 * 根据作业ID和学生ID获取提交记录
 *
 * @param {Number} assignmentId 作业ID
 * @param {String} studentId 学生ID
 * @returns {Promise} 请求Promise
 */
export function getSubmissionByAssignmentIdAndStudentId(assignmentId, studentId) {
  return request({
    url: `/submissions/assignment/${assignmentId}/student/${studentId}`,
    method: 'get'
  })
}

/**
 * 根据ID获取提交记录
 *
 * @param {Number} submissionId 提交记录ID
 * @returns {Promise} 请求Promise
 */
export function getSubmissionById(submissionId) {
  return request({
    url: `/submissions/${submissionId}`,
    method: 'get'
  })
}

/**
 * 获取作业所有提交记录
 *
 * @param {Number} assignmentId 作业ID
 * @returns {Promise} 请求Promise
 */
export function getSubmissionsByAssignmentId(assignmentId) {
  return request({
    url: `/submissions/assignment/${assignmentId}`,
    method: 'get'
  })
} 